<%-- 
    Document   : agendaReunion
    Created on : 07-12-2012, 11:27:04 PM
    Author     : Alex
--%>
<%@include file="/include/struts-tags.jsp" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.uca.sisbec.mapping.Reunion"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">


<%
Reunion r = (Reunion) request.getAttribute("Reunion");
%>

<html>
    <%@include file="/include/head.jsp" %>
    <script type="text/javascript" src="js/functions.js"></script>
    <script type="text/javascript">
    function deleteItem(codigo){
        //var url = getBaseURL();
        //url = url + "AgendaReunion.jsa?cmd=EliminarPuntoAgenda&idPtoAg="+codigo;
        var url = "./AgendaReunion.jsa?cmd=EliminarPuntoAgenda&idPtoAg="+codigo;
        var codR = document.getElementById("idReunion").value;
        url = url + "&idR="+codR;
        var form = document.getElementById("AgendaReunionForm");
        form.action = url;
        form.submit();
    }
    
    function validarForm(){
        var form = document.getElementById("AgendaReunionForm");
        if(form.puntoAgenda.value.trim() == ""){
            $( "#dialog:ui-dialog" ).dialog( "destroy" );
            $( "#dialog-message" ).dialog({minHeight: 70, height: 180, modal: true, buttons: {Ok: function() {$( this ).dialog( "close" );}}});
            return false;
        }
        return true;
    }
    
    </script>
    <body>
        <br />
        <html:form action="/AgendaReunion" styleId="AgendaReunionForm" onsubmit="return validarForm()">
            <html:hidden property="cmd" value="GuardarPuntoAgenda" />
            <input type="hidden" name="idReunion" id="idReunion" value="<%= r.getIdReunion().toString() %>" />
            <table class="form">
                <caption class="titleSeg">Agenda para la Reuni&oacute;n N&deg; <%= r.getIdReunion() %></caption>
                <tr class="campos">
                    <td>Escriba el tema a tratar en la reuni&oacute;n:</td>
                </tr>
                <tr class="campos">
                    <td class="control"><html:text property="puntoAgenda" styleClass="tinput404" /></td>
                </tr>
                <tr>
                    <td align="center">
                        <html:submit value="Agregar" />
                    </td>
                </tr>
                <logic:present name="msg">
                <tr>
                    <td class="success">
                        <html:img src="./images/ok.png" />&nbsp;
                        <html:messages id="mensaje" name="msg">
                            <bean:write name="mensaje" />
                        </html:messages>
                    </td>
                </tr>
                </logic:present>
                <logic:present name="errors">
                <tr>
                    <td class="errors">
                        <html:img src="./images/error.png" />&nbsp;<html:errors name="errors" />
                    </td>
                </tr>
                </logic:present>
            </table>
        </html:form>
            <br /><br />
        <logic:present name="AgendaList" scope="request">
            <display:table pagesize="10" name="AgendaList" requestURI="" class="results" style="width:90%;" id="results">
                <display:column property="id.correlPtoAgenda" title="" style="text-align:center;" decorator="com.uca.sisbec.decorators.AgendaReuDecorator" sortable="true" />
                <display:column property="puntoAgenda" title="Punto en Agenda" sortable="true" />
            </display:table>
        </logic:present>
        <script>
            var table = document.getElementById("results");
            var rows = table.getElementsByTagName("tr");
            for (var i = 1; i < rows.length; i++) {
                rows[i].onmouseover = function() {
                    this.className += ' hilite';
                }
                rows[i].onmouseout = function() {
                    this.className = this.className.replace(' hilite', '');
                }
            }
        </script>
            
    <!-- DIVS DE MENSAJES DE VALIDACIONES -->
    
    <div id="dialog-message" style="display: none" title="Advertencia">
	<p>
            <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
            El tema es obligatorio
	</p>
    </div>
    
    <!-- ******************************* -->
            
    </body>
</html>
